<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/9/12
 * Time: 13:40
 */

use doumiaoduo\layer\LayerConfirmWidget;
use doumiaoduo\layer\LayerIframeWidget;
use common\components\helpers\Fun;
use common\components\extenders\MenuManage;

use doumiaoduo\layer\LayerAsset;

LayerAsset::register($this);

LayerConfirmWidget::widget();
LayerIframeWidget::widget();
?>
    <div class="yx-praise-list-box yx-praise-box yx-radius2 zx-min-height">
        <div class="docs-main">
            <table id="tablesaw" class="tablesaw table yx-table1 yx-table5 table-striped with-check"
                   data-tablesaw-mode="swipe" data-tablesaw-minimap>
                <thead>
                <tr class="yx-bgd2f6ec">
                    <th>序号</th>
                    <th>班主任</th>
                    <th>需结算金额</th>
                    <th>佣金</th>
                    <th>付款状态</th>
                    <th>操作人</th>
                    <th>时间</th>
                    <th>操作</th>
                </tr>
                <?php foreach ($data as $k => $v) { ?>
                    <tr>
                        <td><?= $k + 1 ?></td>
                        <td><?= $v['salesman'] ?></td>
                        <td><?= $v['settlement_amount'] ?></td>
                        <td><?= $v['commission_money'] ?></td>
                        <td><?= $v['status'] ?></td>
                        <td><?= $v['operator'] ?></td>
                        <td><?= $v['created_at'] ?></td>
                        <td>
                            <?php if ($v['is_all'] == 1) { ?>
                                <?php if ($v['status_n'] == 0) { ?>
                                    <a class="btn yx-radius2 yx-d-card yx-bg65d1d4"
                                       data-name='付款付款' data-size="700*700" rel="dialog-show-iframe"
                                       data-url="<?= Fun::url(['headmastercommission/dosettlement', 'commission_settlement_id' => $v['id']]) ?>"">确认付款</a>
                                <?php } else { ?>
                                    <a class="btn yx-radius2 yx-d-card yx-bg65d1d4"
                                       data-name='上传凭证' data-size="700*700" rel="dialog-show-iframe"
                                       data-url="<?= Fun::url(['headmastercommission/uploadvoucher', 'commission_settlement_id' => $v['id']]) ?>"">上传凭证</a>
                                <?php } ?>
                            <?php } ?>
                            <a class="btn yx-radius2 yx-d-card yx-bg65d1d4"
                               data-name='查看详情' data-size="1000*700" rel="dialog-show-iframe"
                               data-url="<?= Fun::url(['headmastercommission/detailssettlement', 'commission_settlement_id' => $v['id'], 'status_n' => $v['status_n']]) ?>"">查看详情</a>
                        </td>
                    </tr>
                <?php } ?>
                </thead>
            </table>
        </div>
    </div>

<?php
$js = <<<JS

JS;
$this->registerJs($js);
?>